//
//  MineViewController.swift
//  YUANSHI
//
//  Created by pro on 2019/12/7.
//  Copyright © 2019 wangbin. All rights reserved.
//

import UIKit

class MineViewController: WBBaseViewController {
    

    lazy var tabelView : UITableView = {
       
        let tabView = UITableView.init(frame: .zero, style: .plain)
        tabView.delegate = self
        tabView.dataSource = self
        
        return tabView
    }()
    let titArr = ["swift多线程","线程安全","swift动画效果","swift音频采集与播放","swift视频采集播放"]
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(self.tabelView)
        self.tabelView.snp.makeConstraints { (make) in
            make.left.top.right.bottom.equalToSuperview()
        }
    }


}

extension MineViewController : UITableViewDataSource,UITableViewDelegate{
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return titArr.count
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell : UITableViewCell = UITableViewCell.init(style: .default, reuseIdentifier: "cell")
        cell.textLabel?.text = titArr[indexPath.row]
        return cell
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        switch indexPath.row {
        case 0:
            let muVc = MultithreadingViewController.init()
            self.navigationController?.pushViewController(muVc, animated: true)
        case 1:
            let muVc = MultithreadSafeViewController.init()
            self.navigationController?.pushViewController(muVc, animated: true)
        case 2:
            let anVc = AnimationViewController.init()
            self.navigationController?.pushViewController(anVc, animated: true)
            
        default: break
            
        }
    }
    
    
    
    
}
